<?php
class ResourceFile extends Resource
{
	private $fileName;
	private $fileSize;
	private $fileType;
	
	public function __construct($database, $resourceID)
	{
		$this->database = $database;
		parent::__construct($database, $resourceID);
		
		if ($resourceID != 0)
		{
			$sql = "SELECT * from Files WHERE ResourceIDP=".$this->resourceID;
//			echo $sql;
			$this->database->ExecuteSQL($sql);
			$row = $this->database->getRow();
			
			$this->fileName = $row['FSFileName'];
			$this->fileSize = $row['FSFileSize'];
			$this->fileType = $row['FSFileType'];

		}
	}
	
	
	public function getDataHTML()
	{
		$html = "<p>".$this->fileName." (".$this->fileSize." bytes) ".$this->fileType."</p>\n";
		
		return $html;
	}
	
}

?>